#ifndef GAMELISTXMLHANDLER_H
#define GAMELISTXMLHANDLER_H

#include <QXmlDefaultHandler>
#include <QMap>

#include "data/Game.h"


class GameListXmlHandler : public QXmlDefaultHandler
{

public:
    explicit GameListXmlHandler();
    virtual bool characters(const QString &str);\
    virtual bool fatalError(const QXmlParseException &exception);
    virtual bool startElement(const QString &namespaceURI, const QString &localName,
                  const QString &qName, const QXmlAttributes &attributes);
    virtual bool endElement(const QString &namespaceURI, const QString &localName,
                const QString &qName);

    QMap<QString, Game> games() const;

private:
    QMap<QString, Game> m_gameMap;
    QString m_currentText;
    Game m_currentGame;
};

#endif // GAMELISTXMLHANDLER_H
